/**
 * 
 */



package com.UMLife.me.action;

import com.UMLife.me.global.Global;
import com.UMLife.me.ui.AboutMeUI;
import de.enough.polish.ui.Command;
import de.enough.polish.ui.CommandListener;
import de.enough.polish.ui.Displayable;
import de.enough.polish.ui.ImageItem;
import de.enough.polish.ui.Item;
import de.enough.polish.ui.ItemCommandListener;





/**
 * Class Information:
 * 
 * @Author yangguang
 * @Date 2009-11-8
 * @Description
 * @MustDos
 */
public class AboutMeAction implements CommandListener, ItemCommandListener
{
	public AboutMeAction(AboutMeUI ui, ImageItem buttonOk)
	{
		this.ui = ui;
		this.cmdBack = Global.getCmdBack();
		this.buttonOk = buttonOk;
		ui.addCommand(this.cmdBack);
		buttonOk.setDefaultCommand(Global.getCmdOk());
		buttonOk.setItemCommandListener(this);
		
	}
	
	public void commandAction(Command c, Displayable d)
	{
		if (c == this.cmdBack)
		{
			Global.getGlobalDisplay().setCurrent(Global.getMainMenu());
		}
		
	}
	
	public void commandAction(Command c, Item i)
	{
		if (i == this.buttonOk)
		{
			//TODO 这些内容，要等到Model层和UI层都协调好的时候添加语句。
			
			/*
			 * AboutMeModel model = Global.getAboutMeModel();
			 * boolean get = model.CanGet();
			 * if (get)
			 * {
			 * //TODO 编写兑奖后的响应动作。
			 * }
			 * if (!get)
			 * {
			 * Alert alert = new Alert("提示");
			 * alert.setString("对不起，您不能够兑奖");
			 * Global.getGlobalDisplay().setCurrent(alert, this.ui);
			 * }
			 */
		}
		
	}
	
	private ImageItem	buttonOk;
	
	private Command		cmdBack;
	
	private AboutMeUI	ui;
	
}
